<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>内容评级平台 - 发现生活中的美好</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        /* 全局样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        :root {
            --primary: #4361ee;
            --secondary: #3f37c9;
            --accent: #4cc9f0;
            --dark: #1d3557;
            --darker: #0d1b2a;
            --light: #f8f9fa;
            --gray: #8d99ae;
            --success: #4caf50;
            --warning: #ff9800;
            --danger: #f44336;
            --card-bg: rgba(29, 53, 87, 0.8);
            --transition: all 0.3s ease;
        }

        body {
            background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
            color: var(--light);
            min-height: 100vh;
            background-attachment: fixed;
            line-height: 1.6;
        }

        /* 页头样式 */
        header {
            background-color: rgba(13, 27, 42, 0.95);
            backdrop-filter: blur(10px);
            padding: 1rem 2rem;
            position: sticky;
            top: 0;
            z-index: 1000;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .header-container {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 15px;
            text-decoration: none;
        }

        .logo-icon {
            font-size: 2.5rem;
            color: var(--accent);
        }

        .logo-text {
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--light);
            letter-spacing: 1px;
        }

        .logo-text span {
            color: var(--accent);
        }

        .nav-links {
            display: flex;
            gap: 2rem;
            list-style: none;
        }

        .nav-links a {
            color: var(--light);
            text-decoration: none;
            font-weight: 500;
            font-size: 1.1rem;
            padding: 0.5rem 1rem;
            border-radius: 30px;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .nav-links a:hover, .nav-links a.active {
            background: rgba(67, 97, 238, 0.2);
            color: var(--accent);
        }

        .nav-links a i {
            font-size: 1.2rem;
        }

        .auth-buttons {
            display: flex;
            gap: 1rem;
        }

        .btn {
            padding: 0.7rem 1.5rem;
            border-radius: 30px;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: var(--transition);
            border: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .btn-primary {
            background: var(--primary);
            color: white;
        }

        .btn-primary:hover {
            background: var(--secondary);
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
        }

        .btn-outline {
            background: transparent;
            border: 2px solid var(--primary);
            color: var(--primary);
        }

        .btn-outline:hover {
            background: rgba(67, 97, 238, 0.1);
            transform: translateY(-2px);
        }

        /* 主内容区样式 */
        .main-content {
            max-width: 1400px;
            margin: 2rem auto;
            padding: 0 2rem;
        }

        /* 搜索区域 */
        .search-section {
            text-align: center;
            padding: 3rem 1rem;
            margin-bottom: 3rem;
        }

        .search-section h1 {
            font-size: 2.8rem;
            margin-bottom: 1rem;
            line-height: 1.2;
        }

        .search-section p {
            font-size: 1.2rem;
            color: var(--gray);
            max-width: 700px;
            margin: 0 auto 2rem;
        }

        .search-box {
            max-width: 700px;
            margin: 0 auto;
            display: flex;
            background: var(--card-bg);
            border-radius: 50px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }

        .search-input {
            flex: 1;
            padding: 1.2rem 1.5rem;
            border: none;
            background: transparent;
            color: var(--light);
            font-size: 1.1rem;
        }

        .search-input:focus {
            outline: none;
        }

        .search-select {
            padding: 0 1.5rem;
            background: rgba(67, 97, 238, 0.3);
            border: none;
            color: var(--light);
            border-right: 1px solid rgba(255, 255, 255, 0.1);
            appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 1rem center;
            background-size: 1em;
        }

        .search-button {
            padding: 0 2rem;
            background: var(--primary);
            color: white;
            border: none;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
        }

        .search-button:hover {
            background: var(--secondary);
        }

        /* 分类导航 */
        .category-section {
            margin-bottom: 3rem;
            padding: 0 1rem;
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .section-title {
            font-size: 1.8rem;
            font-weight: 700;
            position: relative;
            padding-left: 1rem;
        }

        .section-title::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            height: 100%;
            width: 4px;
            background: var(--accent);
            border-radius: 2px;
        }

        .view-all {
            color: var(--accent);
            text-decoration: none;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .categories {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 1.5rem;
        }

        .category-card {
            background: var(--card-bg);
            border-radius: 15px;
            overflow: hidden;
            transition: var(--transition);
            position: relative;
            height: 200px;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            cursor: pointer;
        }

        .category-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
        }

        .category-card::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.8) 90%);
            z-index: 1;
        }

        .category-image {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .category-content {
            position: relative;
            z-index: 2;
            padding: 1.5rem;
        }

        .category-title {
            font-size: 1.3rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
        }

        .category-count {
            color: var(--gray);
            font-size: 0.9rem;
        }

        /* 内容列表样式 */
        .content-section {
            margin-bottom: 3rem;
            padding: 0 1rem;
        }

        .content-tabs {
            display: flex;
            background: var(--card-bg);
            border-radius: 10px 10px 0 0;
            overflow: hidden;
            margin-bottom: 1.5rem;
        }

        .tab {
            padding: 0.8rem 1.5rem;
            cursor: pointer;
            font-weight: 500;
            color: var(--gray);
            transition: var(--transition);
            position: relative;
        }

        .tab.active {
            color: var(--accent);
            background: rgba(67, 97, 238, 0.2);
        }

        .tab:hover:not(.active) {
            background: rgba(255, 255, 255, 0.05);
        }

        .content-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 2rem;
        }

        .content-card {
            background: var(--card-bg);
            border-radius: 15px;
            overflow: hidden;
            transition: var(--transition);
            position: relative;
        }

        .content-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }

        .content-image {
            width: 100%;
            height: 400px;
            object-fit: cover;
            display: block;
        }

        .content-badge {
            position: absolute;
            top: 1rem;
            right: 1rem;
            background: var(--warning);
            color: var(--darker);
            padding: 0.3rem 0.8rem;
            border-radius: 30px;
            font-weight: 600;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .content-info {
            padding: 1.5rem;
        }

        .content-title {
            font-size: 1.3rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .content-meta {
            color: var(--gray);
            margin-bottom: 1rem;
            font-size: 0.9rem;
        }

        .rating {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .stars {
            color: var(--warning);
            display: flex;
            gap: 2px;
        }

        .rating-value {
            font-weight: 600;
        }

        .content-description {
            margin-bottom: 1.5rem;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .content-actions {
            display: flex;
            justify-content: space-between;
        }

        .action-btn {
            display: flex;
            align-items: center;
            gap: 5px;
            color: var(--light);
            background: rgba(255, 255, 255, 0.1);
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 30px;
            cursor: pointer;
            transition: var(--transition);
        }

        .action-btn:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        /* 页脚样式 */
        footer {
            background: rgba(13, 27, 42, 0.95);
            padding: 3rem 2rem 1.5rem;
            margin-top: 3rem;
        }



        .footer-col h3 {
            font-size: 1.3rem;
            margin-bottom: 1.5rem;
            position: relative;
            padding-bottom: 0.5rem;
        }

        .footer-col h3::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            width: 50px;
            height: 2px;
            background: var(--accent);
        }

        .footer-links {
            list-style: none;
        }

        .footer-links li {
            margin-bottom: 0.8rem;
        }

        .footer-links a {
            color: var(--gray);
            text-decoration: none;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .footer-links a:hover {
            color: var(--accent);
            padding-left: 5px;
        }

        .footer-links a i {
            width: 20px;
            text-align: center;
        }



        /* 响应式设计 */
        @media (max-width: 992px) {

            .search-section h1 {
                font-size: 2.2rem;
            }

            .content-grid {
                grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            }
        }

        @media (max-width: 768px) {
            .search-box {
                flex-direction: column;
                border-radius: 15px;
            }

            .search-select {
                padding: 1rem 1.5rem;
                border-right: none;
                border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            }

            .search-button {
                padding: 1rem;
            }

            .categories {
                grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            }
        }

        @media (max-width: 480px) {
            .section-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 1rem;
            }

            .view-all {
                align-self: flex-end;
            }

            .categories {
                grid-template-columns: 1fr 1fr;
            }

            .content-grid {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
<!-- 包含导航栏 -->
<%@ include file="navbar.jsp" %>

<!-- 主内容区 -->
<div class="main-content">
    <!-- 搜索区域 - 修改表单提交方式 -->
    <section class="search-section">
        <h1>发现生活中值得体验的内容</h1>
        <p>探索来自全球用户的真实评价，找到最适合您的书籍、电影和音乐</p>

        <form id="searchForm" class="search-box" action="${pageContext.request.contextPath}/search" method="get">
            <input type="text" class="search-input" id="query" name="query" placeholder="搜索电影、图书或音乐..." required>
            <select class="search-select" id="type" name="type">
                <option value="all">全部类型</option>
                <option value="movie">电影</option>
                <option value="book">图书</option>
                <option value="music">音乐</option>
            </select>
            <button type="submit" class="search-button"><i class="fas fa-search"></i>搜索</button>
        </form>
    </section>

    <!-- 显示搜索结果 -->
    <c:if test="${not empty requestScope.results}">
        <section class="content-section">
            <div class="section-header">
                <h2 class="section-title">搜索结果</h2>
                <div>找到 ${requestScope.total} 条结果</div>
            </div>

            <div class="search-results">
                <c:forEach items="${requestScope.results}" var="result">
                    <div class="result-item">

                        <div class="result-content">
                            <h3 class="result-title">${result.title}</h3>
                            <div class="result-meta">
                                <c:choose>
                                    <c:when test="${result.type == 'movie'}">
                                        ${result.author} | ${result.year} | 电影
                                    </c:when>
                                    <c:when test="${result.type == 'book'}">
                                        ${result.author} | ${result.year} | 图书
                                    </c:when>
                                    <c:when test="${result.type == 'music'}">
                                        ${result.author} | ${result.year} | 音乐
                                    </c:when>
                                </c:choose>
                            </div>
                            <p class="result-description">${result.description}</p>
                            <div class="result-rating">
                                <div class="stars">
                                    <c:forEach begin="1" end="5" var="i">
                                        <c:choose>
                                            <c:when test="${i <= result.rating}">
                                                <i class="fas fa-star"></i>
                                            </c:when>
                                            <c:when test="${i - 0.5 <= result.rating && result.rating < i}">
                                                <i class="fas fa-star-half-alt"></i>
                                            </c:when>
                                            <c:otherwise>
                                                <i class="far fa-star"></i>
                                            </c:otherwise>
                                        </c:choose>
                                    </c:forEach>
                                </div>
                                <span class="rating-value">${result.rating}</span>
                                <span>(${result.reviewCount} 条评论)</span>
                            </div>
                            <div class="result-actions">
                                <a href="${pageContext.request.contextPath}/content/detail?id=${result.id}&type=${result.type}"
                                   class="btn btn-primary">
                                    <i class="fas fa-info-circle"></i> 查看详情
                                </a>
                                <button class="btn btn-outline" onclick="addToFavorites('${result.title}')">
                                    <i class="far fa-star"></i> 收藏
                                </button>
                            </div>
                        </div>
                    </div>
                </c:forEach>
            </div>
        </section>
    </c:if>

    <!-- 分类导航 -->
    <section class="category-section">
        <div class="section-header">
            <h2 class="section-title">浏览分类</h2>
            <a href="categories.jsp" class="view-all">查看全部 <i class="fas fa-chevron-right"></i></a>
        </div>

        <div class="categories">
            <a href="movies.jsp" class="category-card">
                <img src="https://picsum.photos/400/300?random=1" alt="电影分类" class="category-image">
                <div class="category-content">
                    <h3 class="category-title">电影</h3>
                    <div class="category-count">1,245 部作品</div>
                </div>
            </a>

            <a href="books.jsp" class="category-card">
                <img src="https://picsum.photos/400/300?random=2" alt="图书分类" class="category-image">
                <div class="category-content">
                    <h3 class="category-title">图书</h3>
                    <div class="category-count">2,879 本图书</div>
                </div>
            </a>

            <a href="music.jsp" class="category-card">
                <img src="https://picsum.photos/400/300?random=3" alt="音乐分类" class="category-image">
                <div class="category-content">
                    <h3 class="category-title">音乐</h3>
                    <div class="category-count">845 张专辑</div>
                </div>
            </a>

            <a href="tv-shows.jsp" class="category-card">
                <img src="https://picsum.photos/400/300?random=4" alt="电视剧分类" class="category-image">
                <div class="category-content">
                    <h3 class="category-title">电视剧</h3>
                    <div class="category-count">367 部剧集</div>
                </div>
            </a>

            <a href="documentaries.jsp" class="category-card">
                <img src="https://picsum.photos/400/300?random=5" alt="纪录片分类" class="category-image">
                <div class="category-content">
                    <h3 class="category-title">纪录片</h3>
                    <div class="category-count">198 部作品</div>
                </div>
            </a>
        </div>
    </section>

    <!-- 热门内容 -->
    <section class="content-section">
        <div class="section-header">
            <h2 class="section-title">热门内容</h2>
        </div>

        <div class="content-tabs">
            <div class="tab active">热门电影</div>
            <div class="tab">热门图书</div>
            <div class="tab">最新内容</div>
            <div class="tab">用户推荐</div>
        </div>

        <div class="content-grid">
            <div class="content-card">
                <img src="https://picsum.photos/400/600?random=10" alt="星际穿越海报" class="content-image">
                <div class="content-badge"><i class="fas fa-fire"></i>热门</div>
                <div class="content-info">
                    <h3 class="content-title">星际穿越</h3>
                    <div class="content-meta">克里斯托弗·诺兰 | 2014 | 科幻/冒险</div>
                    <div class="rating">
                        <div class="stars">
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star-half-alt"></i>
                        </div>
                        <div class="rating-value">4.7</div>
                    </div>
                    <p class="content-description">在不远的未来，地球环境逐渐恶化，人类面临生存危机。一群探险家利用新发现的虫洞，计划超越人类太空旅行的极限，在广袤的宇宙中进行星际航行...</p>
                    <div class="content-actions">
                        <button class="action-btn" onclick="window.location.href='movie-detail.jsp?id=1'"><i class="far fa-comment"></i>评论</button>
                        <button class="action-btn" onclick="addToFavorites('星际穿越')"><i class="far fa-star"></i>收藏</button>
                        <button class="action-btn" onclick="shareContent('星际穿越', 'movie')"><i class="fas fa-share"></i>分享</button>
                    </div>
                </div>
            </div>

            <div class="content-card">
                <img src="https://picsum.photos/400/600?random=11" alt="三体书籍封面" class="content-image">
                <div class="content-badge"><i class="fas fa-book"></i>图书</div>
                <div class="content-info">
                    <h3 class="content-title">三体</h3>
                    <div class="content-meta">刘慈欣 | 2008 | 科幻小说</div>
                    <div class="rating">
                        <div class="stars">
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                        </div>
                        <div class="rating-value">4.9</div>
                    </div>
                    <p class="content-description">《三体》是刘慈欣创作的系列长篇科幻小说，讲述了地球人类文明和三体文明的信息交流、生死搏杀及两个文明在宇宙中的兴衰历程...</p>
                    <div class="content-actions">
                        <button class="action-btn" onclick="window.location.href='book-detail.jsp?id=1'"><i class="far fa-comment"></i>评论</button>
                        <button class="action-btn" onclick="addToFavorites('三体')"><i class="far fa-star"></i>收藏</button>
                        <button class="action-btn" onclick="shareContent('三体', 'book')"><i class="fas fa-share"></i>分享</button>
                    </div>
                </div>
            </div>

            <div class="content-card">
                <img src="https://picsum.photos/400/600?random=12" alt="肖申克的救赎海报" class="content-image">
                <div class="content-badge"><i class="fas fa-film"></i>电影</div>
                <div class="content-info">
                    <h3 class="content-title">肖申克的救赎</h3>
                    <div class="content-meta">弗兰克·德拉邦特 | 1994 | 剧情</div>
                    <div class="rating">
                        <div class="stars">
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                        </div>
                        <div class="rating-value">4.9</div>
                    </div>
                    <p class="content-description">该片改编自斯蒂芬·金《四季奇谭》中收录的同名小说，主要讲述了银行家安迪因被误判为枪杀妻子及其情人的罪名入狱后...</p>
                    <div class="content-actions">
                        <button class="action-btn" onclick="window.location.href='movie-detail.jsp?id=2'"><i class="far fa-comment"></i>评论</button>
                        <button class="action-btn" onclick="addToFavorites('肖申克的救赎')"><i class="far fa-star"></i>收藏</button>
                        <button class="action-btn" onclick="shareContent('肖申克的救赎', 'movie')"><i class="fas fa-share"></i>分享</button>
                    </div>
                </div>
            </div>

            <div class="content-card">
                <img src="https://picsum.photos/400/600?random=13" alt="盗梦空间海报" class="content-image">
                <div class="content-badge"><i class="fas fa-film"></i>电影</div>
                <div class="content-info">
                    <h3 class="content-title">盗梦空间</h3>
                    <div class="content-meta">克里斯托弗·诺兰 | 2010 | 科幻/惊悚</div>
                    <div class="rating">
                        <div class="stars">
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                        </div>
                        <div class="rating-value">4.8</div>
                    </div>
                    <p class="content-description">影片剧情游走于梦境与现实之间，被定义为"发生在意识结构内的当代动作科幻片"，讲述由莱昂纳多·迪卡普里奥扮演的造梦师...</p>
                    <div class="content-actions">
                        <button class="action-btn" onclick="window.location.href='movie-detail.jsp?id=3'"><i class="far fa-comment"></i>评论</button>
                        <button class="action-btn" onclick="addToFavorites('盗梦空间')"><i class="far fa-star"></i>收藏</button>
                        <button class="action-btn" onclick="shareContent('盗梦空间', 'movie')"><i class="fas fa-share"></i>分享</button>
                    </div>
                </div>
            </div>

            <div class="content-card">
                <img src="https://picsum.photos/400/600?random=14" alt="活着封面" class="content-image">
                <div class="content-badge"><i class="fas fa-book"></i>图书</div>
                <div class="content-info">
                    <h3 class="content-title">活着</h3>
                    <div class="content-meta">余华 | 1993 | 小说</div>
                    <div class="rating">
                        <div class="stars">
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star-half-alt"></i>
                        </div>
                        <div class="rating-value">4.8</div>
                    </div>
                    <p class="content-description">讲述了在大时代背景下，随着内战、三反五反、大跃进、文化大革命等社会变革，徐福贵的人生和家庭不断经受着苦难...</p>
                    <div class="content-actions">
                        <button class="action-btn" onclick="window.location.href='book-detail.jsp?id=2'"><i class="far fa-comment"></i>评论</button>
                        <button class="action-btn" onclick="addToFavorites('活着')"><i class="far fa-star"></i>收藏</button>
                        <button class="action-btn" onclick="shareContent('活着', 'book')"><i class="fas fa-share"></i>分享</button>
                    </div>
                </div>
            </div>

            <div class="content-card">
                <img src="https://picsum.photos/400/600?random=15" alt="Imagine Dragons专辑封面" class="content-image">
                <div class="content-badge"><i class="fas fa-music"></i>音乐</div>
                <div class="content-info">
                    <h3 class="content-title">Night Visions</h3>
                    <div class="content-meta">Imagine Dragons | 2012 | 摇滚</div>
                    <div class="rating">
                        <div class="stars">
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star-half-alt"></i>
                        </div>
                        <div class="rating-value">4.6</div>
                    </div>
                    <p class="content-description">美国摇滚乐队梦龙的首张录音室专辑，包含多首热门单曲如"Radioactive"、"Demons"等，融合了另类摇滚、电子和流行元素...</p>
                    <div class="content-actions">
                        <button class="action-btn" onclick="window.location.href='music-detail.jsp?id=1'"><i class="far fa-comment"></i>评论</button>
                        <button class="action-btn" onclick="addToFavorites('Night Visions')"><i class="far fa-star"></i>收藏</button>
                        <button class="action-btn" onclick="shareContent('Night Visions', 'music')"><i class="fas fa-share"></i>分享</button>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>

<!-- 包含页脚 -->
<%@ include file="footer.jsp" %>

<script>
    document.addEventListener('DOMContentLoaded', function() {
        // 检查登录状态
        checkLoginStatus();

        // 初始化标签页
        initTabs();

        // 初始化导航栏高亮
        initNavHighlight();
    });

    // 检查登录状态并更新UI
    function checkLoginStatus() {
        // 实际应用中从session获取
        const isLoggedIn = ${not empty sessionScope.user};
        const username = isLoggedIn ? '${sessionScope.user.username}' : '';

        if (username) {
            console.log("当前用户: ", username);
        }
    }

    // 初始化标签页
    function initTabs() {
        const tabs = document.querySelectorAll('.tab');
        tabs.forEach(tab => {
            tab.addEventListener('click', function() {
                tabs.forEach(t => t.classList.remove('active'));
                this.classList.add('active');

                // 在实际应用中这里会加载不同内容
                console.log('显示' + this.textContent + '内容');
            });
        });
    }

    // 初始化导航栏高亮
    function initNavHighlight() {
        const navLinks = document.querySelectorAll('.nav-links a');
        navLinks.forEach(link => {
            if (link.href === window.location.href) {
                link.classList.add('active');
            }
        });
    }

    // 添加到收藏
    function addToFavorites(itemName) {
        alert(`${itemName} 已添加到收藏夹`);
        // 这里可以添加实际的收藏逻辑
    }

    // 分享功能
    function shareContent(itemName, type) {
        // 这里可以添加实际的分享逻辑
        alert(`分享${type}: ${itemName}`);
    }
</script>
</body>
</html>